import { createRequest } from "../utils/http.js";
import { GET_REALVALS, LOAD_CHART_MONTHD, LOAD_CHART_YEAR, LOAD_CHART_DAY,  LOAD_CHART_HOUR} from "../utils/api.js";

export default {
  getRealval: async (data, ctx) => {
    const res = await createRequest(
      GET_REALVALS,
      data,
      ctx, 'POST'
    );
    return res;
  },
  loadYear: async (data, ctx) => {
    const res = await createRequest(
      LOAD_CHART_YEAR,
      data,
      ctx, 'POST'
    );
    return res;
  },
  loadDay: async (data, ctx) => {
    const res = await createRequest(
      LOAD_CHART_DAY,
      data,
      ctx, 'POST'
    );
    return res;
  },
  loadHour: async (data, ctx) => {
    const res = await createRequest(
      LOAD_CHART_HOUR,
      data,
      ctx, 'POST'
    );
    return res;
  },
  loadMonth: async (data, ctx) => {
    const res = await createRequest(
      LOAD_CHART_MONTHD,
      data,
      ctx, 'POST'
    );
    return res;
  },
};
